<template>
  <div class="header-box">
      <div class="header-content is-home">
        <div class="header-center clearfix">
          <div class="ellipsis logo-box f-l">
            <img src="~assets/images/teacher/header_logo.png" />
          </div>
          <ul id="headerNav" class="header-nav f-l">
            <li id="navhome" class="active">
              <a href="/" class="router-link-exact-active router-link-active">首页</a>
              <span class="active-span"></span>
            </li>
            <li id="naveducation" class>
              <a href="/education" class>教学中心</a>
              <span class="active-span"></span>
            </li>
            <li id="navtextbook" class>
              <a href="/textbook" class>教学资源</a>
              <span class="active-span"></span>
            </li>
            <li id="navimprove" class>
              <a href="/improve" class>教学提升</a>
              <span class="active-span"></span>
            </li>
            <li id="navask" class>
              <a href="/ask" class>问答精灵</a>
              <span class="active-span"></span>
            </li>
          </ul>
          <div class="header-user f-r">

            <div  class="user-intro-box" v-if="user == null">
              <div  class="header-motto">
                <span  class="login-btn primary-linear" @click="flag=true">登录</span>
                <span  class="register-btn">注册</span>
              </div>
            </div>
            <div  class="user-intro-box" v-else>
              <div  class="header-motto">
                <span  class="login-btn primary-linear" @click="logout">退出</span>
              </div>
            </div>

          </div>
        </div>
      </div>
      <teacher :flag="flag" v-if="flag" />
  </div>
</template>

<script>
import Teacher from "../Teacher"

export default {
  components:{Teacher},
  data() {
    return {
      flag:false,
      user:JSON.parse(localStorage.getItem('token')),
    };
  },
  methods: {
    login_dialog(){

    }
  },
};
</script>

<style scoped>

.header-box{
  width: 100%;
  height: 60px;
  /* border: 1px solid red; */
}

.header-content.is-home {
    -webkit-box-shadow: 14px 2px 52px 0 #accdf8;
    box-shadow: 14px 2px 52px 0 #accdf8;
    margin-bottom: 13px;
}
.header-content.is-home {
    -webkit-box-shadow: 14px 2px 52px 0 #accdf8;
    box-shadow: 14px 2px 52px 0 #accdf8;
    margin-bottom: 13px;
}
.header-content .header-center {
    width: 1200px;
    margin: auto;
}
.header-content {
    width: 100%;
    line-height: 60px;
    background: #fff;
    letter-spacing: 2px;
    color: #9aabb8;
}
.header-content .logo-box{
  height: 60px;
    font-size: 20px;
    font-weight: 700;
    padding-left: 15px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    margin-right: 180px;
    line-height: 60px;
}

.ellipsis{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-content .logo-box img {
    width: 216px;
    margin-top: 17px;
}
.f-l {
    float: left;
}
.header-nav {
    height: 60px;
    padding-left: 10px;
    font-size: 16px;
    line-height: 50px;
    padding-top: 10px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: block;
}
p, pre, ul {
    margin: 0;
    padding: 0;
}
.header-nav .active {
    color: #1058fa;
    font-size: 18px;
    font-weight: 700;
    position: relative;
}
.header-nav .active {
    color: #1058fa;
    font-size: 18px;
    font-weight: 700;
    position: relative;
}
li {
    list-style: none;
}
.header-nav li {
    width: 108px;
    text-align: center;
    float: left;
    position: relative;
}
.header-nav li a {
    display: inline-block;
    height: 100%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-transition: all .2s;
    transition: all .2s;
}
a {
    text-decoration: none;
    color: inherit;
}
.header-nav .active .active-span {
    width: 2em;
}
.header-nav li .active-span {
    width: 0;
    height: 4px;
    display: block;
    border-radius: 4px;
    -webkit-transition: all .3s;
    transition: all .3s;
    position: absolute;
    z-index: 2;
    bottom: -4px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    background: linear-gradient(325deg,#4aa4ff,#1058fa);
}
.header-user {
    height: 60px;
}
.f-r {
    float: right;
}
.header-motto {
    height: 60px;
    line-height: 70px;
}
.header-motto span.login-btn {
    border: none;
    color: #fff;
    margin-right: 25px;
}
.header-motto span {
    display: inline-block;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    padding-left: 2px;
    height: 30px;
    width: 70px;
    line-height: 30px;
    border-radius: 16px;
    border: 1px solid #e1e7ec;
    text-align: center;
    cursor: pointer;
}
.primary-linear {
    background: linear-gradient(325deg,#4aa4ff,#1058fa);
}
</style>